<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center member_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub member_fd0_0'>
					<view class='flex flex-wrap align-center member_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
						data-url="1">
						<text class='fu-iconfont2  member_fd0_0_c0_c0'>&#xe794;</text>
					</view>
					<text class='member_fd0_0_c1'>会员权益</text>
					<view class='flex flex-wrap align-center member_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout member_flex_1">
				<view class='flex flex-wrap align-center member_fd1_0'>
					<image class='member_fd1_0_c0' mode="aspectFit" :src='userData.avatar'></image>
					<view class='flex flex-direction flex-wrap align-stretch flex-sub'>
						<view class='flex flex-wrap align-center member_fd1_0_c1_c0'>
							<text class='flex-sub member_fd1_0_c1_c0_c0'>{{userData.nickname}}</text>
						</view>
						<view class='flex flex-wrap align-center'>
							<image class='member_fd1_0_c1_c1_c0' mode="aspectFit" :src='STATIC_URL+"544.png"'></image>
							<text class='member_fd1_0_c1_c1_c1'>{{userData.level.name || '非会员'}}</text>
						</view>
						<view class='flex flex-wrap align-center member_fd1_0_c1_c2' v-if=" userData.level.levelid!=0">
							<text class='member_fd1_0_c1_c2_c0'>有效期：</text>
							<text class='member_fd1_0_c1_c2_c0'>{{userData.dengjidaoqishijian}}</text>
						</view>
					</view>
				</view>
			</view>

			<!---flex布局flex布局结束-->
			<!---flex布局flex布局开始-->
			<view class="flex benben-flex-layout flex-wrap align-center member_flex_2">
				<view style="position: relative">
					<swiper ref="benbenSwiperfd2_0" :current='curDot' @change="carouselChangesFunc($event)"
						class='flex position-relative member_fd2_0' previous-margin="24rpx" next-margin="24rpx"
						:display-multiple-items="1" :interval="5000" :duration="500" :autoplay='false' :circular='true'>

						<template v-for='(item,key0) in memberList'>
							<swiper-item class='flex  member_fd2_0' :key='key0'>
								<view class='flex flex-direction flex-wrap align-stretch member_fd2_0_c1_c0'>
									<view class='flex flex-wrap align-center member_fd2_0_c1_c0_c0'>
										<image class='member_fd2_0_c1_c0_c0_c0' mode="aspectFit" :src='item.tupian'>
										</image>
										<view
											class='flex flex-direction flex-wrap align-stretch flex-sub member_fd2_0_c1_c0_c0_c1'>
											<text class='member_fd2_0_c1_c0_c0_c1_c0'
												:style="{'color':`${memberList[curDot].color}`}">{{item.name}}</text>
											<view class='flex flex-wrap align-center member_fd2_0_c1_c0_c0_c1_c1'
												:style="{'color':`${memberList[curDot].color}`}">
												<text class='member_fd2_0_c1_c0_c0_c1_c1_c0'>自购买之日起，</text>
												<text
													class='member_fd2_0_c1_c0_c0_c1_c1_c0'>{{item.youxiaoshichang}}</text>
												<text class='member_fd2_0_c1_c0_c0_c1_c1_c0'>年内有效</text>
											</view>
											<view class='flex flex-wrap align-center'
												:style="{'color':`${memberList[curDot].color}`}">
												<text class='member_fd2_0_c1_c0_c0_c1_c2_c0'>￥</text>
												<text class='member_fd2_0_c1_c0_c0_c1_c2_c1'>{{item.goumaijine}}</text>
												<text class='member_fd2_0_c1_c0_c0_c1_c2_c2'>价值</text>
												<text class='member_fd2_0_c1_c0_c0_c1_c2_c3'>￥</text>
												<text class='member_fd2_0_c1_c0_c0_c1_c2_c3'>{{item.empirical}}</text>
											</view>
										</view>
									</view>
									<view class='flex flex-direction flex-wrap align-stretch member_fd2_0_c1_c0_c1'>
										<text class='member_fd2_0_c1_c0_c1_c0'>特权说明</text>
										<text class='member_fd2_0_c1_c0_c1_c1'>{{item.content}}</text>
									</view>
								</view>
							</swiper-item>
						</template>

					</swiper>
				</view>
			</view>

			<!---flex布局flex布局结束-->
			<view class="flex flex-direction flex-wrap align-stretch benben-position-layout flex member_flex_30001"
				:style="{height:(180+bottomSafeAreaRpx)+'rpx',paddingBottom:bottomSafeAreaRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-center member_fd3_00001'>
					<benben-flex-switch-new class-name='flex flex member_fd3_0_c00001' v-model="select"
						:disabled='false' :auto='true'>
						<template v-slot:checked>
							<view class='flex flex position-relative align-center'>
								<image class='member_checkfd3_0_c0_c0_c00001' mode="aspectFit"
									:src='STATIC_URL+"133.png"'>
								</image>
							</view>
						</template>
						<template v-slot:unchecked>
							<view class='flex flex position-relative justify-end align-center'>
								<image class='member_noCheckfd3_0_c0_c1_c00001' mode="aspectFit"
									:src='STATIC_URL+"331.png"'></image>
							</view>
						</template>
					</benben-flex-switch-new>
					<text class='member_fd3_0_c10002'>已阅读并同意</text>
					<text class='member_fd3_0_c10001' @tap.stop="handleJumpDiy" data-type="navigateTo"
						:data-url="`/pages/login/memberPurchase/memberPurchase`">《会员购买协议》</text>
				</view>
				<view class='flex flex-wrap align-center'>
					<button class='flex-sub member_fd3_1_c00001' @tap.stop="postMemberFunc(curDot)">立即购买</button>
				</view>
			</view>
			<view :style="{height: (180+bottomSafeAreaRpx)+'rpx'}"></view>
		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},


		data() {
			return {
				"select": false,
				"bottomSafeAreaRpx": '',
				"bannerIndexfd2_0": 0,
				"userData": {
					"invite_code": "",
					"address": "",
					"address_code": "",
					"hobby": "",
					"tags": "",
					"id": "",
					"userlevel_id": "",
					"mobile": "",
					"real_name": "",
					"nickname": "",
					"avatar": "",
					"account": "",
					"email": "",
					"birthday": "",
					"gender": "",
					"create_time": "",
					"user_money": "",
					"freeze_money": "",
					"total_consumption_money": "",
					"score": "",
					"collection_count": "",
					"browse_count": "",
					"total_money": "",
					"certified": "",
					"is_pay_password": "",
					"fuwuxingji": "",
					"gongzuozhuangtai": "",
					"shuzi": "",
					"jifen": "",
					"yajin": "",
					"level": {
						"aid": "",
						"name": "",
						"icon": "",
						"levelid": "",
						"bag": ""
					},
					"dengjidaoqishijian": "",
					"suozaidi": "",
					"huiyuanyue": "",
					"invite": "",
					"auto_order": false,
					"practice_time": "",
					"idcard_no": "",
					"phone": "",
					"idcard_portrait": "",
					"idcard_emblem": "",
					"meisterbrief": [],
					"content": "",
					"coupon_coun": "",
					"followNum": "",
					"desc": "",
					"withdrawal": {
						"ratio": "",
						"ratio_decs": ""
					},
					"commission": ""
				},
				"memberList": [],
				"submitData": {
					"order_sn": "",
					"payment_money": "",
					"cancel_time": ""
				},
				"curDot": 0
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			this.getUserFunc()
			this.getMemberFunc()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取用户信息
			async getUserFunc() {
				//请求方法
				//数据验证

				let datauserData = await this.$api.get(global.apiUrls.post5c78c4772da97, {

				});

				if (datauserData.data.code != 1) {
					this.$message.info(datauserData.data.msg);
					return
				}
				let infouserData = datauserData.data;
				this.userData = infouserData.data

			},
			//获取会员列表
			async getMemberFunc() {
				//请求方法
				//数据验证

				let datamemberList = await this.$api.get(global.apiUrls.post636dc24bbf63d, {

				});

				if (datamemberList.data.code != 1) {
					this.$message.info(datamemberList.data.msg);
					return
				}
				let infomemberList = datamemberList.data;
				this.memberList = infomemberList.data

			},
			//提交会员
			async postMemberFunc(val) {
				console.log(val, '1111111111');
				if (this.select === false) {
					this.$message.info('请先阅读并同意《会员购买协议》');
					return false;
				}
				let data = this.memberList[val]
				let datasubmitData = await this.$api.dbPost(global.apiUrls.post63db833520b85, {
					userlevel_id: data.aid
				});
				if (!datasubmitData) return
				if (datasubmitData.data.code != 1) {
					this.$message.info(datasubmitData.data.msg);
					return
				}
				let infosubmitData = datasubmitData.data;
				this.submitData = infosubmitData.data
				this.$urouter.redirectTo(
					`/pages/index/cashier/cashier?money=${this.submitData.zhifujine}&order_sn=${this.submitData.dingdanbianhao}&order_type=16`
				);
			},
			//轮播变更
			carouselChangesFunc(e) {
				this.curDot = e.detail.current;
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: url(image-path('542.png')) no-repeat, rgba(248, 248, 248, 1);
		background-size: 100% auto;
	}

	.member_flex_0 {
		background: url(image-path('542.png')) no-repeat, transparent;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.member_fd0_0_c1 {
		font-size: 36rpx;
		font-weight: 500;
		color: #fff;
	}

	.member_fd0_0_c0_c0 {
		font-size: 32rpx;
		color: #fff;
	}

	.member_fd0_0_c0 {
		width: 120rpx;
		height: 88rpx;
	}

	.member_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
	}

	.member_flex_1 {
		padding: 50rpx 24rpx 24rpx 24rpx;
	}

	.member_fd1_0_c1_c2_c0 {
		font-size: 24rpx;
		font-weight: 400;
		color: rgba(95, 60, 22, 1);
	}

	.member_fd1_0_c1_c2 {
		margin: 16rpx 0rpx 0rpx 0rpx;
	}

	.member_fd1_0_c1_c1_c1 {
		color: #5F3C16;
		font-size: 28rpx;
		font-weight: 400;
		line-height: 40rpx;
	}

	.member_fd1_0_c1_c1_c0 {
		width: 26rpx;
		height: 23rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 8rpx 0rpx 0rpx;
	}

	.member_fd1_0_c1_c0_c0 {
		color: #5F3C16;
		font-size: 42rpx;
		font-weight: 500;
		line-height: 50rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
	}

	.member_fd1_0_c1_c0 {
		margin: 0rpx 0rpx 20rpx 0rpx;
	}

	.member_fd1_0_c0 {
		border: 2px solid var(--benbenbdColor1);
		width: 142rpx;
		height: 142rpx;
		border-radius: 80rpx 80rpx 80rpx 80rpx;
		margin: 0rpx 32rpx 0rpx 0rpx;
	}

	.member_fd1_0 {
		background: url(image-path('543.png')) no-repeat;
		background-size: 100% auto !important;
		padding: 48rpx 48rpx 48rpx 48rpx;
	}

	.member_flex_2 {
		padding: 0rpx 0rpx 0rpx 0rpx;
	}

	.member_numberfd2_0_c0 {
		background: #525050;
		position: absolute;
		bottom: 20rpx;
		right: 30rpx;
		width: 80rpx;
		height: 40rpx;
		border-radius: 6rpx 6rpx 6rpx 6rpx;
		font-size: 24rpx;
		color: #FFFFFF;
		line-height: 46rpx;
		font-weight: 400;
	}

	.member_fd2_0_c1_c0_c1_c1 {
		color: #333333;
		font-size: 24rpx;
		font-weight: 400;
		line-height: 40rpx;
	}

	.member_fd2_0_c1_c0_c1_c0 {
		color: #333333;
		font-size: 28rpx;
		font-weight: 400;
		line-height: 40rpx;
		margin: 0rpx 0rpx 10rpx 0rpx;
	}

	.member_fd2_0_c1_c0_c1 {
		background: var(--benbenbgColor1);
		padding: 24rpx;
		background-size: 100% auto;
		border-radius: 0rpx 0rpx 16rpx 16rpx;
	}

	.member_fd2_0_c1_c0_c0_c1_c2_c3 {
		font-size: 24rpx;
		font-weight: 400;
		line-height: 33rpx;
		text-decoration: line-through;
	}

	.member_fd2_0_c1_c0_c0_c1_c2_c2 {
		font-size: 24rpx;
		font-weight: 400;
		line-height: 33rpx;
		text-decoration: line-through;
		margin: 0rpx 0rpx 0rpx 16rpx;
	}

	.member_fd2_0_c1_c0_c0_c1_c2_c1 {
		font-size: 56rpx;
		font-weight: 700;
		line-height: 78rpx;
	}

	.member_fd2_0_c1_c0_c0_c1_c2_c0 {
		font-size: 32rpx;
		font-weight: 700;
		line-height: 78rpx;
	}

	.member_fd2_0_c1_c0_c0_c1_c1_c0 {
		font-size: 24rpx;
		font-weight: 400;
		line-height: 33rpx;
	}

	.member_fd2_0_c1_c0_c0_c1_c1 {
		margin: 12rpx 0rpx 73rpx 0rpx;
	}

	.member_fd2_0_c1_c0_c0_c1_c0 {
		font-size: 48rpx;
		font-weight: 700;
		line-height: 67rpx;
		margin: 48rpx 0rpx 0rpx 0rpx;
	}

	.member_fd2_0_c1_c0_c0_c1 {
		position: absolute;
		width: 638rpx;
		height: 320rpx;
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.member_fd2_0_c1_c0_c0_c0 {
		width: 638rpx;
		height: 320rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.member_fd2_0_c1_c0_c0 {
		position: relative;
	}

	.member_fd2_0_c1_c0 {
		width: 646rpx;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		padding: 20rpx 0rpx 0rpx 0rpx;
	}

	.member_fd2_0 {
		width: 750rpx;
		height: 60vh;
	}

	.member_swiperDotUnselectedfd2_0 {
		border: 1px solid rgba(0, 0, 0, 0.3);
		background: rgba(0, 0, 0, 0.3);
		width: 16rpx;
		height: 16rpx;
		border-radius: 100rpx 100rpx 100rpx 100rpx;
		margin: 0rpx 6rpx 0rpx 0rpx;
		font-size: 24rpx;
		color: #fff;
	}

	.member_swiperDotSelectedfd2_0 {
		border: 1px solid #00A7FF;
		background: #00A7FF;
		width: 16rpx;
		height: 16rpx;
		border-radius: 100rpx 100rpx 100rpx 100rpx;
		margin: 0rpx 6rpx 0rpx 0rpx;
		font-size: 24rpx;
		color: #fff;
	}

	::v-deep .member_swiperDotfd2_0 {
		position: absolute;
		bottom: 20rpx;
		left: 0rpx;
		right: 0rpx;
	}

	.member_flex_3 {
		width: 750rpx;
		height: 120rpx;
		overflow: hidden;
		z-index: 10;
		bottom: calc(0rpx + var(--window-bottom));
	}

	.member_fd3_0 {
		background: var(--benbenbgColor2);
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		font-size: 32rpx;
		color: #fff;
		margin: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
		line-height: 88rpx;
	}

	//会员样式
	.member_flex_30001 {
		width: 750rpx;
		height: 180rpx;
		overflow: hidden;
		z-index: 10;
		bottom: calc(0rpx + var(--window-bottom));
	}

	::v-deep .member_fd3_0_c00001 {
		margin: 0rpx 16rpx 0rpx 0rpx;
	}

	.member_fd3_00001 {
		margin: 0rpx 32rpx 20rpx 32rpx;
	}

	.member_fd3_0_c10001 {
		font-size: 24rpx;
		font-weight: 400;
		color: rgba(227, 29, 26, 1);
	}

	.member_fd3_0_c10002 {
		font-size: 24rpx;
		font-weight: 400;
		color: #333333;
	}

	.member_checkfd3_0_c0_c0_c00001 {
		width: 28rpx;
		height: 28rpx;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
	}

	.member_noCheckfd3_0_c0_c1_c00001 {
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		width: 28rpx;
		height: 28rpx;
	}

	.member_fd3_1_c00001 {
		background: var(--benbenbgColor2);
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		font-size: 32rpx;
		color: #fff;
		margin: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
		line-height: 88rpx;
	}
</style>